
export function transformCanvasPointerXY(
    canvas: HTMLCanvasElement, rawX: number, rawY: number, cw: number, ch: number) 
        : { px: number, py: number } {

    let [h, w] = [canvas.clientHeight, canvas.clientWidth]
    let [uvX, uvY] = [rawX / w, rawY / h]
    
    return {
        px: uvX * cw, 
        py: uvY * ch
    }
}
